package se.teamscape.shared.rpc;

import net.customware.gwt.dispatch.shared.Action;

/**
 * Generic action to fetch a model implementation.
 * 
 * @author Andreas Borglin
 * 
 */
@SuppressWarnings( { "serial" })
public class GetModel implements Action<GetModelResult> {

    private String mId;
    private String mClassName;

    GetModel() {
    }

    public GetModel(String id, String className) {
        this.mId = id;
        this.mClassName = className;
    }

    public String getId() {
        return mId;
    }

    public String getClassName() {
        return mClassName;
    }

    @Override
    public boolean equals(Object object) {
        if (object instanceof GetModel && ((GetModel) object).getId().equals(mId)) {
            return true;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return mId.hashCode();
    }
}
